Geometrize  1.0
An application for geometrizing images into geometric primitives
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
geometrize::dialog::OpenUrlDialog Class Reference

The OpenUrlDialog class models the UI for the dialog box users can enter URLs into to open remote images or webpages. More...

#include <openurldialog.h>

Inheritance diagram for geometrize::dialog::OpenUrlDialog:
Inheritance graph
[legend]
Collaboration diagram for geometrize::dialog::OpenUrlDialog:
Collaboration graph
[legend]

Public Member Functions

 OpenUrlDialog (QWidget *parent=nullptr)
 
virtual ~OpenUrlDialog ()
 
QUrl getUrl () const
 getUrl Gets the URL the user entered into the dialog. More...
 

Protected Member Functions

void changeEvent (QEvent *) override
 

Private Slots

void on_buttonBox_accepted ()
 
void on_buttonBox_rejected ()
 

Private Member Functions

void populateUi ()
 

Private Attributes

Ui::OpenUrlDialog * ui
 

Detailed Description

The OpenUrlDialog class models the UI for the dialog box users can enter URLs into to open remote images or webpages.

Constructor & Destructor Documentation

geometrize::dialog::OpenUrlDialog::OpenUrlDialog ( QWidget *  parent = nullptr)
explicit
15  :
16  QDialog(parent),
17  ui(new Ui::OpenUrlDialog)
18 {
19  setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); // Remove question mark from title bar
20  ui->setupUi(this);
21  populateUi();
22 }
Ui::OpenUrlDialog * ui
Definition: openurldialog.h:45
void populateUi()
Definition: openurldialog.cpp:60

Here is the call graph for this function:

geometrize::dialog::OpenUrlDialog::~OpenUrlDialog ( )
virtual
25 {
26  delete ui;
27 }
Ui::OpenUrlDialog * ui
Definition: openurldialog.h:45

Member Function Documentation

void geometrize::dialog::OpenUrlDialog::changeEvent ( QEvent *  event)
overrideprotected
52 {
53  if (event->type() == QEvent::LanguageChange) {
54  ui->retranslateUi(this);
55  populateUi();
56  }
57  QDialog::changeEvent(event);
58 }
Ui::OpenUrlDialog * ui
Definition: openurldialog.h:45
void populateUi()
Definition: openurldialog.cpp:60

Here is the call graph for this function:

QUrl geometrize::dialog::OpenUrlDialog::getUrl ( ) const

getUrl Gets the URL the user entered into the dialog.

Returns
The URL the user entered into the dialog.
30 {
31  const QString userText{ui->urlLineEdit->text()};
32  const QUrl url{QUrl::fromUserInput(userText)};
33 
34  // We want remote URLs only, local files are opened with an "Open File" button
35  if(url.isLocalFile() || url.isEmpty()) {
36  return QUrl::fromUserInput(ui->urlLineEdit->placeholderText());
37  }
38  return url;
39 }
Ui::OpenUrlDialog * ui
Definition: openurldialog.h:45

Here is the caller graph for this function:

void geometrize::dialog::OpenUrlDialog::on_buttonBox_accepted ( )
privateslot
42 {
43  close();
44 }
void geometrize::dialog::OpenUrlDialog::on_buttonBox_rejected ( )
privateslot
47 {
48  close();
49 }
void geometrize::dialog::OpenUrlDialog::populateUi ( )
private
61 {
62 
63 }

Here is the caller graph for this function:

Member Data Documentation

Ui::OpenUrlDialog* geometrize::dialog::OpenUrlDialog::ui
private

The documentation for this class was generated from the following files: