MCPcopy Create free account
hub / github.com/baumgarr/nixnote2 / FindReplace

Method FindReplace

gui/findreplace.cpp:31–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29extern Global global;
30
31FindReplace::FindReplace(QWidget *parent) :
32 QWidget(parent)
33{
34 QHBoxLayout *layout = new QHBoxLayout();
35 this->setLayout(layout);
36
37 findLine = new QLineEdit(this);
38 closeButton = new QPushButton(this);
39
40 closeButton->setIcon(global.getIconResource(":filecloseIcon"));
41 closeButton->setStyleSheet("border:none;");
42 connect(closeButton, SIGNAL(clicked()), this, SLOT(hide()));
43
44 findLine->setMaximumWidth(300);
45
46 nextButton = new QPushButton(tr("Next"));
47 prevButton = new QPushButton(tr("Previous"));
48 caseSensitive = new QCheckBox(tr("Match case"));
49
50
51 QSpacerItem *spacer = new QSpacerItem(this->width()/3,findLine->height(), QSizePolicy::MinimumExpanding);
52
53 replaceLine = new QLineEdit();
54
55 replaceLine = new QLineEdit();
56 replaceLine->setMaximumWidth(300);
57 replaceButton = new QPushButton(tr("Replace"), this);
58 replaceAllButton = new QPushButton(tr("Replace all"),this);
59
60 QVBoxLayout *closeLayout = new QVBoxLayout();
61 closeLayout->addWidget(closeButton);
62 QLabel *closeSpacer = new QLabel(this);
63 closeLayout->addWidget(closeSpacer);
64
65 QVBoxLayout *lineLayout = new QVBoxLayout();
66 lineLayout->addWidget(findLine);
67 lineLayout->addWidget(replaceLine);
68
69 QVBoxLayout *button1Layout = new QVBoxLayout();
70 button1Layout->addWidget(nextButton);
71 button1Layout->addWidget(replaceButton);
72
73 QVBoxLayout *button2Layout = new QVBoxLayout();
74 button2Layout->addWidget(prevButton);
75 button2Layout->addWidget(replaceAllButton);
76
77 QVBoxLayout *checkLayout = new QVBoxLayout();
78 checkLayout->addWidget(caseSensitive);
79 checkLayout->addSpacerItem(spacer);
80
81 layout->addLayout(closeLayout);
82 layout->addLayout(lineLayout);
83 layout->addLayout(button1Layout);
84 layout->addLayout(button2Layout);
85 layout->addLayout(checkLayout);
86
87 nextButton->setDisabled(true);
88 prevButton->setDisabled(true);

Callers

nothing calls this directly

Calls 2

getIconResourceMethod · 0.80
addWidgetMethod · 0.80

Tested by

no test coverage detected